package meituan.d20210904.t1;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 * <li style="color: red;">Prob</li>
 *
 * <li style="color: red;">Desc</li>
 *
 * <li style="color: red;">Link</li>
 *
 * @author habitplus
 * @since 2021-09-04 17:32
 */
public class Main {

    public static void main(String[] args) throws IOException {
        BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));

        int n = Integer.parseInt(bf.readLine());
        bf.close();

        if (n > 0) {
            System.out.println(func("", n));
        } else {
            System.out.println(0);
        }
    }

    private static int func(String s, int n) {
        if (s.length() > n) {
            return 0;
        } else  if (s.length() == n) {
            return 1;
        }

        int ans = 0;

        String t = s + "a";
        if (!t.contains("aba") && !t.contains("bab")) {
            ans += func(t, n);
        }

        t = s + "b";
        if (!t.contains("aba") && !t.contains("bab")) {
            ans += func(t, n);
        }

        return ans;
    }
}
